<div style="padding-top: 2em">
    <fieldset class="AuthField" id="AuthField">
        <legend>Авторизация пользователя</legend>

        <table class="AuthForm" id="AuthForm">
            <tbody>
                <tr>
                    <td class="Lable">Тип</td>
                    <td><?php echo $this->UserTypes()->ToHtml(); ?></td>
                </tr>
                <tr><td></td><td class="ErrorMessage" data-field="log"></td></tr>

                <tr>
                    <td class="Lable">Логин </td>
                    <td><input type="text" id="login" class="Text"/></td>
                </tr>
                <tr><td></td><td class="ErrorMessage" data-field="login"></td></tr>

                <tr>
                    <td class="Lable">Пароль </td>
                    <td><input type="password" id="pass" class="Text"/></td>
                </tr>
                <tr><td></td><td class="ErrorMessage" data-field="pass"></td></tr>
            </tbody>
        </table>

        <div class="PageMenu"><button id="submit">Вход</button></div>

    </fieldset>

    <script type="text/javascript">

        jsun('#submit').jsun.event({ onclick: Login });
        jsun('#AuthForm').addEventListener('keypress', PressEnter, true) ;

        function Login() {
            jsun.json.load(function(p) {
                if (p.STAT == 'OK') {
                    window.location.href = p.URL;
                } else {
                    jsun.show_err(p);
                }
            }, "u=Index/Login" + jsun.page.get_data());
        }

        function PressEnter(p) {
            if (p.keyCode == 13) Login();
        }

    </script>
</div>